package com.kingdee.jdy.demo;

import com.kingdee.jdy.controller.VoucherController;
import com.kingdee.jdy.domain.AccountInfo;
import com.kingdee.jdy.util.AccessTokenUtil;
import com.kingdee.jdy.util.AccountInfoUtil;
import java.util.HashMap;

/**
 *运行main方法可新增一张凭证
 */
public class voucherDemo {
	
	public static void main(String[] args) throws Exception {
	    //数据准备
		String accessToken = AccessTokenUtil.GetAccessToken();
        AccountInfo accountInfo = AccountInfoUtil.GetAccountInfo(accessToken);

        HashMap<String, Object> urlParam = new HashMap<>();
        urlParam.put("access_token", accessToken);
        HashMap<String, Object> headerParam = new HashMap<>();
        headerParam.put("accountId", accountInfo.getAccountId());
        headerParam.put("groupName", accountInfo.getGroupName());

        //同步销售订单
        VoucherController.saveVoucher(urlParam, headerParam);
    }



}
